﻿using System;

namespace K9Nano.Settings;

[Serializable]
public class SettingInfo
{
    /// <summary>
    /// UserId for this setting.
    /// UserId is null if this setting is not user level.
    /// </summary>
    public long? UserId { get; set; }

    /// <summary>
    /// Unique name of the setting.
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// Value of the setting.
    /// </summary>
    public string Value { get; set; }
    
    /// <summary>
    /// Creates a new <see cref="SettingInfo"/> object.
    /// </summary>
#nullable disable
    // ReSharper disable once NotNullMemberIsNotInitialized
    public SettingInfo()
    {
#nullable enable
    }

    /// <summary>
    /// Creates a new <see cref="SettingInfo"/> object.
    /// </summary>
    /// <param name="userId">UserId for this setting. UserId is null if this setting is not user level.</param>
    /// <param name="name">Unique name of the setting</param>
    /// <param name="value">Value of the setting</param>
    public SettingInfo(long? userId, string name, string value)
    {
        UserId = userId;
        Name = name;
        Value = value;
    }
}